#!/bin/bash
#

read -p "用户名：" name

#判断用户是否存在
if id $name &> /dev/null; then
    #获取用户uid，gid
    uid=$(id -u $name)
    gid=$(id -g $name)
    #判断uid，gid
    if [ "$uid" -eq "$gid" ];then
        echo "YES"
    else
        echo "NO"
    fi
else
    echo "用户${name}"不存在
fi
